package org.ceteca.explica.client.gui;

import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;

public class EntityExtensionCatalogResizeListener implements Listener {
	private Composite composite;
	private Text text;
	private int inset;
	
	public EntityExtensionCatalogResizeListener(Composite composite, Text text, int inset) {
		this.composite = composite;
		this.text = text;
		this.inset = inset;
	}
	
	public void handleEvent (Event e) {
		Rectangle rect = composite.getClientArea ();
		text.setBounds (rect.x + inset, rect.y + inset, rect.width - inset * 2, rect.height - inset * 2);
	}
}
